<!DOCTYPE html><html lang="zh-CN"><head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>weekYear() | Moment.js &#x6587;&#x6863;</title>
  <link rel="stylesheet" href="static/css/style.css">
  <link rel="shortcut icon" href="http://momentjs.cn/static/img/moment-favicon.png">
  <link rel="stylesheet" href="static/css/atom-one-light.min.css">
</head>
<body class="is-moment">
  <div class="hero hero-oneline">
    <div class="hero-centered">
      <h1>weekYear()</h1>
    </div>
  </div>
  <div id="api-section-__FILENAME__">
    <div id="content" class="clearfix">
  
      <div id="column1" data-id="__ID__" class="interior">
        <header>
          <!-- <h1>weekYear()</h1> -->
          <div id="gtoc">
            <ul>
              <!-- <li>v</li> -->
              <li>
                <a href="index.html#/get-set/week-year/" name="toc">&#x8FD4;&#x56DE;&#x4E0A;&#x5C42;&#x6587;&#x6863;</a>
              </li>
              <li style="border: none;">
                <a href="javascript:window.open('https://github.com/momentjscn/moment-docs-cn/edit/master/moment/02-get-set/15-week-year.md');" rel="nofollow" target="_blank">&#x63D0;&#x4EA4;&#x4FEE;&#x6539;</a>
              </li>
              <!-- <li>
                <a href="/search__SEARCH_PARAM__" name="toc">搜索</a>
              </li> -->
            </ul>
          </div>
          <hr>
        </header>

        <div id="biz_item"></div>
  
        <div id="apicontent">
          <div id="content_left">
							<div class="docs-method-signature">
								<pre><code class="language-js">moment().weekYear(Number);
moment().weekYear(); // &#x6570;&#x5B57;
</code></pre>

							</div>
<p>&#x6839;&#x636E;&#x8BED;&#x8A00;&#x73AF;&#x5883;&#x83B7;&#x53D6;&#x6216;&#x8BBE;&#x7F6E;&#x5468;&#x5E74;&#x3002;</p>
<p>&#x56E0;&#x4E3A;&#x7B2C;&#x4E00;&#x5468;&#x7684;&#x7B2C;&#x4E00;&#x5929;&#x5E76;&#x4E0D;&#x603B;&#x662F;&#x5728;&#x4E00;&#x5E74;&#x7684;&#x7B2C;&#x4E00;&#x5929;&#xFF0C;&#x6240;&#x4EE5;&#x6709;&#x65F6;&#x5468;&#x5E74;&#x4E0E;&#x6708;&#x5E74;&#x4F1A;&#x6709;&#x6240;&#x4E0D;&#x540C;&#x3002;</p>
<p>&#x4F8B;&#x5982;&#xFF0C;&#x5728;&#x7F8E;&#x56FD;&#xFF0C;&#x5305;&#x542B; 1 &#x6708; 1 &#x65E5;&#x7684;&#x661F;&#x671F;&#x59CB;&#x7EC8;&#x662F;&#x7B2C;&#x4E00;&#x5468;&#x3002;
&#x5728;&#x7F8E;&#x56FD;&#xFF0C;&#x661F;&#x671F;&#x4E5F;&#x4ECE;&#x661F;&#x671F;&#x65E5;&#x5F00;&#x59CB;&#x3002;
&#x5982;&#x679C; 1 &#x6708; 1 &#x65E5;&#x662F;&#x661F;&#x671F;&#x4E00;&#xFF0C;&#x5219; 12 &#x6708; 31 &#x65E5;&#x4E0E; 1 &#x6708; 1 &#x65E5;&#x5C5E;&#x4E8E;&#x540C;&#x4E00;&#x5468;&#xFF0C;&#x56E0;&#x6B64;&#x4E0E; 1 &#x6708; 1 &#x65E5;&#x7684;&#x5468;&#x5E74;&#x76F8;&#x540C;&#x3002;
12 &#x6708; 30 &#x65E5;&#x5219;&#x4E0E; 12 &#x6708; 31 &#x65E5;&#x662F;&#x4E0D;&#x540C;&#x7684;&#x5468;&#x5E74;&#x3002;</p>
					</div>
          <div id="content_right">
							<div class="docs-method-signature">
								<pre><code class="language-js">moment().weekYear(Number);
moment().weekYear(); // Number
</code></pre>

							</div>
<p>Gets or sets the week-year according to the locale.</p>
<p>Because the first day of the first week does not always fall on the first day of the year, sometimes the week-year will differ from the month year.</p>
<p>For example, in the US, the week that contains Jan 1 is always the first week. In the US, weeks also start on Sunday. If Jan 1 was a Monday, Dec 31 would belong to the same week as Jan 1, and thus the same week-year as Jan 1. Dec 30 would have a different week-year than Dec 31.</p>
					</div>
          <div></div>
        </div>
      </div>
    </div>
  </div>
  
  <script src="static/js/highlight.min.js"></script>
  <script src="static/js/javascript.min.js"></script>
  <script>hljs.initHighlightingOnLoad();</script>
  <script>var _hmt = _hmt || []; (function () { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?7a7f78c805fbacc7e075d34f153031aa"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();</script>

  <style>
    .hero-centered {
      margin: 0;
          margin-left: 10px;
    }
#gtoc ul {
  list-style: none;
  margin-left: 0;
  line-height: 1.5rem;
  padding: 0;
}
#gtoc>ul>li {
  display: inline;
  border-right: 1px solid #000;
  margin-right: .4rem;
  padding-right: .4rem;
}
#gtoc>ul>li>a {
  color: #61b2a7;
}
#content_left {
  width: 49%;float: left;border-right: 1px solid #eee;    padding-right: 2%;
}
#content_right {
float: left;width: 48%;margin-left: 3%;
}
#column1 {
  padding: 0 2rem;
}
  </style>


</body></html>